package com.alisls.shequtao.service.goods.dto;

import com.alisls.shequtao.common.model.dto.BaseDTO;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * 商品分类DTO
 *
 * @author Ke Wang
 */
@Accessors(chain = true)
@Getter
@Setter
@ToString
public class CategoryDTO extends BaseDTO {

    /**
     * 上级商品分类
     */
    private CategoryDTO parentCategoryDTO;

    @NotBlank(message = "商品分类名称不能为空！")
    @Size(min = 2, max = 50, message = "商品分类名称长度介于2~50个字符之间")
    private String categoryName;

    /**
     * 是否叶子节点
     */
    private Integer leaf;

    /**
     * 排序值
     */
    private Integer sort;

}
